package com.example.myblog_ssm.service;

import com.example.myblog_ssm.entity.Comment;
import com.example.myblog_ssm.mapper.CommentMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22479
 * Date: 2023-03-29
 * Time: 15:49
 */
@Service
public class CommentService {

    @Resource
    private CommentMapper commentMapper;

    /**
     * 发布评论
     *
     * @param comment
     * @return
     */
    public int putComment(Comment comment) {
        return commentMapper.putComment(comment);
    }

    /**
     * 读取评论
     *
     * @param aid
     * @return
     */
    public List<Comment> getComment(Integer aid) {
        return commentMapper.getComment(aid);
    }
}
